Skip to content

fix(live): refuse live peers from Claude Code subagents; stop claims late Codex registrations - #180

Merged
ClementWalter merged 2 commits into
mainfrom
fix/live-subagent-and-codex-stop
Dec 4, 2026
Merged

ClementWalter merged 2 commits into
mainfrom
fix/live-subagent-and-codex-stop

Conversation

@ClementWalter

Copy link
Copy Markdown
Owner

Two live-relay bugs seen when a Claude Code session ran peers through in-process subagents.

Subagents could not be live peers. A subagent (Agent tool) shares its parent's process and environment, so live whoami named the parent session, live spawn headed the peers' briefs with that address, and every reply landed in the parent's conversation. The full env of a main session and of its subagent are identical, so no env var tells them apart. What does: Claude Code writes a Bash call's tool_use line to the transcript before starting its shell. router.subagent_caller takes the command line of the shell Claude Code started and matches it against the in-flight Bash calls of <session>.jsonl and <session>/subagents/agent-<id>.jsonl. A match in a subagent file makes live whoami, live send and live spawn refuse, naming the fix: spawn the lead with live spawn claude, or use the board. Limit: MCP tool calls have no shell, so a subagent calling them is not detected (documented in README and SKILL.md).

Verified end to end: in a claude -p main session live whoami printed its address; in a subagent of that same session it refused with This runs inside Claude Code subagent a5fc55066a385ca2b ....

live stop listed spawned Codex agents as "(never registered)". Codex waited on its hooks-trust prompt ("Review hooks / Trust all and continue") past the 120 s spawn timeout, so spawn exited and its spawned.json row kept an empty address. Once the prompt was answered, Codex registered, but nothing wrote the address back: live stop listed it as never registered and refused it by address. Spawn now records the session ids running before the start, and live stop gives each running row without an address the new session in its folder that no other row claims.

Nothing to do before merge or deploy.

…e up

A Codex held on its hooks-trust prompt past the spawn timeout registered once
someone answered it, but its spawned.json row kept an empty address: `live stop`
listed it as never registered and refused it by address. Spawn now records the
harness sessions running before the start, and `live stop` gives each running
row without an address the new session in its folder that no row claims yet.
A subagent shares its parent's process and environment (verified: the full env
is identical), so whoami named the parent and every peer reply landed in the
parent's conversation. The shell Claude Code's Bash tool starts is matched
against the in-flight Bash calls of the session's transcripts; a match in
subagents/agent-<id>.jsonl refuses with the fix: spawn the lead with
`live spawn claude`, or use the board. MCP calls have no shell and stay
undetected, as documented.
@ClementWalter
ClementWalter merged commit 56ade7c into main Dec 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant